//
//  MyTask_RootViewController.m
//  Coding_My
//
//  Created by showXxie on 2017/8/21.
//  Copyright © 2017年 sooxie. All rights reserved.
//

#import "MyTask_RootViewController.h"

@interface MyTask_RootViewController ()


@end

@implementation MyTask_RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor yellowColor];
    
    
    UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [self.view addSubview:loginBtn];
    loginBtn.backgroundColor = kColorBrandGreen;
    
    [loginBtn addTarget:self action:@selector(loginAction:) forControlEvents:UIControlEventTouchUpInside];
    
    
    [loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.view).offset(200);
        make.left.equalTo(self.view).offset(20);
        make.right.equalTo(self.view).offset(-20);
        make.height.mas_equalTo(44);
        
    }];
}


- (void)loginAction:(UIButton *)button {
    
    // 通知第一个控制器，告诉它，按钮被点了
    
    // 通知代理
    // 判断代理信号是否有值
    if (self.delegateSignal) {
        // 有值，才需要通知
        [self.delegateSignal sendNext:nil];
    }
    
    [UIView animateWithDuration:3 animations:^{
        CGAffineTransform transform = button.transform;
        button.transform = CGAffineTransformRotate(transform, M_PI_4);
        
    }];

    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
